//
//  MyWalletView.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/5.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "MyWalletView.h"

@implementation MyWalletView

- (id)initWithFrame:(CGRect)aFrame inSuperView:(UIView *)aSuperView
{
    if (self = [super initWithFrame:aFrame inSuperView:aSuperView]) {
        self.backgroundColor = [UIColor colorWithHexString:@"#A89A60"];
        
        GLGWImageView *baImgV = [[GLGWImageView alloc] initWithImageName:@"" inSuperView:self];
        [baImgV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.bottom.equalTo(self);
        }];
        
        GLGWButton *lefBtn = [[GLGWButton alloc] initInSuperView:self];
        [lefBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self);
            make.top.equalTo(self.mas_top).offset(kHeightProportion_In_iPhoneTriploid(44));
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(39)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(44)));
        }];
        [lefBtn setImage:[UIImage imageNamed:@"icon_fanhui"] forState:UIControlStateNormal];
        [lefBtn addTarget:self action:@selector(leftAction:) forControlEvents:UIControlEventTouchUpInside];
        
        GLGWLabel *labe = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#FFFFFF"] inSuperView:self];
        [labe mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self);
            make.top.equalTo(self.mas_top).offset(kHeightProportion_In_iPhoneTriploid(106));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(20)));
        }];
        labe.text = @"余额(元)";
        labe.textAlignment = NSTextAlignmentCenter;
        
        GLGWLabel *moneyLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(25) theColor:[UIColor colorWithHexString:@"#FFFFFF"] inSuperView:self];
        [moneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self);
            make.top.equalTo(labe.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(17));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(34)));
        }];
        moneyLab.text = @"66,666.66";
        moneyLab.textAlignment = NSTextAlignmentCenter;
    }
    return self;
}

- (void)leftAction:(GLGWButton *)sender
{
    if (self.BlockLeftBtn) {
        self.BlockLeftBtn(sender);
    }
}

@end
